# _*_ coding: utf-8 _*_
"""
Time:     2024/8/27
Author:   2051261
File:     query_factory.py
"""
from typing import Type

from extractor.const import ConstKey
from extractor.model.sql_build.mysql import MySQLQBuilder
from extractor.model.sql_build.mssql import MSSQLBuilder
from extractor.model.sql_build.base import SQLBuilder


class SQLBuilderFactory:
    @staticmethod
    async def get_query_builder(database_type: str) -> Type[SQLBuilder]:
        if database_type == ConstKey.MYSQL:
            return MySQLQBuilder
        elif database_type == ConstKey.MSSQL:
            return MSSQLBuilder
        else:
            raise ValueError("Unsupported database type")
